
public final class RandomRange {

	public static void main(String[] args) {
		int min = 100;
		int max = 999;

		int value = (int) (min + Math.random() * (max - min));

		if (value <= min || value >= max) {
			return;
		}

		System.out.printf("number= %d  ", value );


		int d1 = value % 10;
		//System.out.println (d1 );
		int d2 = value % 100 /10;
		//System.out.println(d2);
		int d3 = value % 1000 / 100;
		//System.out.println(d3);

		int m = d1;
		if (m < d2) {
			m = d2;
		}
		if (m < d3) {
			m = d3;
		}

		System.out.printf("max number = %d ", m);
		
	}
}
